home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Free 63
/
Commodore_Free_Issue_63_2012-08-06_-.d64
/
cp_m iv a
< prev
next >
Wrap
Text File
|
2023-02-26
|
12KB
|
459 lines
*************************************
REDISCOVERING CP/M
Part 4
By Commodoreman
*************************************
After reviewing the information from
these four articles, I realized that
this is as far as I have been with
CP/M. With this realization, this
will be the last article of the
Rediscovery series. However, there
is a lot of information I would like
to research and I plan to use the
Checklist and List of Resources for
this purpose. I also have plans to
write more articles with this
information as well.
There has been a lot of information
to absorb during the first three
Parts and this article is no
exception (this is the largest one
so far). I have organized this
article as follows...
This intro, briefly discussing my
progress, overview of checklist
items solved, a look to perceived
future dabbling in CP/M, more on ED,
more command utilities, Summary of
learned concepts; followed by the
Checklist and List of Resources.
I like the idea of the Checklist. It
helps me to keep an organized list
of questions and things to do. As I
delve deeper into CP/M, there will
be additional items to add. As I
find the answer to a question or
problem, I will cross it off the
list. For easier reference, I will
place at the end of each item that
has been crossed off-where I found
the answer and had documented it
(like this... < Part 4 >).
I have been able to strike some from
the list since Part 3. Refer to the
Checklist at the end to see what has
been accomplished.
Due to the amount of referencing I
do, the Digital Research Guides (the
one with the User's Guide,
Programmer's Guide, and System
Guide) I will simply reference them
accordingly. If reference is to
other sources, I will do so in a way
which will be easy to distinguish.
Be sure to check the list of sources
at the end of the article.
In this, the 4th instalment, I
wanted to continue with more work on
the ED utility. I have been able to
create a file and save it to disk. I
have also re-opened the file to try
to add more text. When I went to
insert text into the file, it did
not display the text already there.
When I typed in some text and saved
it, the new information was appended
to the beginning of the file. I
expect to gain a greater
understanding of how this utility
works (by now I would assume that
many of you are thinking that I
should just find a good word
processor - and that is definitely
one to add to the Checklist).
My List of Resources has grown as
well. I have been on the internet
searching for additional material
and have found quite a bit! You will
probably notice this as you view the
List of Resources, and I have listed
individual files with the internet
address for convenience.
Also, this information is (or soon
will be) available on my website (as
well as any software I can get a
hold of - see List of Resources for
the URL).
Looking ahead to the future, I see a
significant investment in time to
learn more sophisticated concepts -
such as programming in CP/M. This is
likely to be a high-level language
along with some work learning Z80
assembly language. From my current
perspective, I see this being a bit
more difficult as I do not have
direct access to a network of actual
CP/M users. However, I am confident
that with the amount of digital and
paper material I have collected, I
will be able to do quite a bit.
After the basics, I have an interest
in areas of programming software
(and hardware too), so I will
probably focus future efforts there.
CHECKLIST ITEMS - ITEMS CROSSED OFF
THE LIST:
I tried to access a 5 1/4 CP/M disk
on my tower (windows 98) machine. I
was not able to read this disk. I
was disappointed I was not able to
immediately access this disk.
However, I thought that maybe there
is a utility somewhere for Windows
98/DOS that can read a CP/M
formatted disk (add to checklist)
I found the MS-DOS program AnaDisk.
However, I was unable to read the
CP/M disk with this program also.
I Downloaded and ran FreeFile from
Herne. This MS-DOS utility does not
copy or read CP/M disks, although it
boasts the ability to format disks
in numerous formats (I might try
this feature later).
The date which is displayed on
startup is the date of the System
Disk. It is likely I'll have to find
a newer updated version (strike one
from the checklist and add another).
See how to set the date after the
section on ED.
I have found there are many
high-level languages available for
CP/M. Among these are: BASIC,
FORTRAN, COBOL, APL, C, and PASCAL.
Some programs can be found on
Zimmer's website her
(www.zimmers.net).
ED
Before I started this session, I did
finally buckle under and switch
monitors. I decided the convenience
of an 80 column display was worth
it. Although, for those of you who
do not have access to such a
monitor, you should still be able to
follow along - remember that to
scroll to the other half of the
screen using the CONTROL key with
the cursor right/left (the cursor
keys at the top of the keyboard).
I figured out how to edit an
existing text file. Here's more of
what I learned. In order to see the
text from the file, the text must be
loaded into the memory buffer. When
ED starts, there is RAM allocated
for text. However, unlike most
editors I have seen, ED does not
load the text from the file into the
buffer, this must be done manually.
Here's how to do it...
ed test1.tex <RETURN>
ED will start with the TEST1.TEX
file. Then the ED prompt will be
displayed...
:*
To see the text from the TEST1.TEX
file, we need to Append (copy) the
text to the buffer...
#a <RETURN>
Now the text is copied and ED shows
this...
1:*
Enter this in at this prompt again
to see the text printed on the
screen...
b#t <RETURN>
ED is showing the line numbers of
the text in the file. The line
numbers are not contained in the
file itself, but are there for ease
of editing. If there is a need to
change a specific line, the line
number is provided.
Here is what my screen displays...
A>b:
B>ed test1.tex
: *#a
1: b#t
1: another line.
2:
3:
4:
5: Here is a text file for testing
on the Commodore CP/M machine.
1: *
The actual text was displayed
following the ED commands 'b#t'.
Before explaining these commands, I
think it is a good idea to go over
what a Command Point (CP) is...
"ED treats a file as a long chain of
characters grouped together in
lines. ED displays and edits
characters and lines in relation to
an imaginary device called the
character pointer (CP). During an
edit session, you must mentally
picture the CP's location in the
memory buffer and issue commands to
move the CP and edit the file
(User's Guide, p. 6-8)".
To successfully operate within the
ED environment, it is crucial to
understand what the CP is and how to
manipulate it. By knowing exactly
where the CP is in the text buffer,
we can manipulate our input,
changes, or deletions with
exactness. Remember, as we are
working with ED, while in Insert
mode, we cannot use the DELete key
as we would in a word processor. If
there is a mistake, text will have
to be manipulated via the editor to
correct it (and it is a little more
difficult than just using a word
processor). One thing for sure, as
soon as I get my hands on a decent
text editor, I'll be 'shelving' ED.
Anyway, continuing on...
Going back to the screen listing
above, I will add text to line 3.
Here is how it is done...
This will be done using the 'L'
(Line command) to instruct ED to
move the CP to line 3. Enter in the
following...
2l <RETURN>
ED displays...
3:*
Now go into Insert mode by typing
the letter i followed by <RETURN>.
ED is now awaiting input for that
line. Let's type in the following...
new line. <RETURN>
ESCape out of Insert mode. Type in
the following...
b#t <RETURN>
and ED will display the updated
buffer text file.
Notice the additional text entered
on line 3. I used the Line command
to position the CP. Here we
specified 2L and the CP was placed
in position for line 3.
When I typed in 'b#t' ED executed
two commands. The 'b' is actually
the command that moves the CP to the
beginning of the buffer, and the
'#t' is the Type command telling ED
to type out the lines of text from
the CP position to the end of the
file (buffer). This is an important
point to notice. Multiple commands
can be entered at the ED prompt to
perform more than one task at a time.
Another thing to watch out for -
notice that there are now 6 lines.
ED actually inserted another line
between 2 and 3. This is where the
new text was placed. What if I did
not want to have a blank line 4?
Simple, I will use the Kill (k)
command. Enter in the following (two
commands will be used)...
3l1k <RETURN>
ED will show a 4: prompt, at which
time enter in...
b#t <RETURN>
and now ED should have printed the
following on the display...
1: another line.
2:
3: new line.
4:
5: Here is a text file for testing
the Commodore CP/M machine.
1:*
So now what do I do if I had
mistakenly typed this instead...
new line
Here is what to do (well, one way to
do it)...
1. ESCape from Insert mode
2. We will go to the beginning of
the buffer by entering in 'b'
3. Move ahead two lines by entering
in '2L' (L can be upper or lower
case)
4. Kill line 3 by entering '1k'
5. Go to Insert mode
6. Type in the new line of text
7. ESCape
8. And we're done
Basically I deleted the line and
inserted a new one in its place.
But, there is another way of
inserting text to a line. While
analyzing the commands in the User's
Guide, I found another way of
entering text. This method allows
the use of the delete key, if I
catch the mistake before committing
it to the buffer. Here's how it
works...
At the ED prompt, enter the
following...
iNew line. <RETURN>
Notice the 'i' and the 'N' are not
spaced? 'I' signals ED to insert the
characters immediately following to
the current CP in the buffer.
This brings up another question, how
do I insert text or make a change to
an existing line (as opposed to
typing the whole line over)?
The User's Guide (p. 6-10) provides
us with what we need to know. Moving
the CP requires us to input certain
commands at the ED prompt (we must
mentally picture where the CP is).
By issuing the 'B' Command, we move
the CP to the beginning of the
buffer. If we wanted to go to the
end, we would enter '-B'. To move to
somewhere in-between, we use the 'L'
(line) command. To go to line 12,
the command would look like this -
11L <RETURN>. If we need to move the
CP within a line, we use the 'C'
command. Like the Line command, we
need to put a number before the 'C'.
A positive number moves the CP to
the right, a negative number moves
the CP to the left.
Example:
:* b Move CP to beginning of
buffer
:* 2L Position CP at beginning
of line 3
:* 10C Move CP 10 characters to
the right
:* iText.^Z Insert text at current
CP. Use CONTROL-Z to
finish
:* b#t Move CP to beginning of
buffer and List text to
screen
Deleting characters is done this
way...
:* 2L Move CP to beginning of
line 3
:* 10C Move CP to the 10th character
of line 3
:* 10D Delete 10 characters from CP
to end of line
:* b#t Move CP to beginning of buf-
fer and List text to screen
to be sure 'More text' was
deleted
To me, I found ED to be a bit
strange and awkward to work with.
The User's Guide specifies the
purpose of ED is "used primarily to
create and edit program source files
(p.6-10). For now, what I have
learned about this utility will do.
Continued in part B